const { defineConfig } = require('@vue/cli-service')
const path = require('path');
const resolve = (dir) => path.join(__dirname, dir);

module.exports = defineConfig({
  transpileDependencies: true,
  chainWebpack: (config) => {
    config.resolve.alias
      .set('@', resolve('./src/'))
  },
  devServer: {
    open: true,
    port: 8080,
    proxy: {
      '/1/indexes': {
        target: 'https://a4a8oaqd9t-3.algolianet.com/1/indexes',
        ws: true,
        changeOrigin: true,
        // pathReWrite: {
        //     '^/': ''
        // }
      },
      '/graphql': {
        target: 'https://a4a8oaqd9t-3.algolianet.com',
        ws: true,
        changeOrigin: true,
        // pathReWrite: {
        //     '^/': ''
        // }
      },
    }
  },
})
